package prv.pursuivant.core.impl;

import static org.junit.Assert.assertSame;

import org.junit.Before;
import org.junit.Test;

import prv.pursuivant.core.AchievType;
import prv.pursuivant.core.AchievTypesTree;
import prv.pursuivant.core.AchievTypesTreeImpl;

import com.google.inject.internal.Lists;

public class CategoryTest {

	private AchievType naxx;
	private AchievType q1;
	private AchievType q2;
	private AchievType q3;
	private AchievType q4;
	private AchievTypesTree dungeonsAndRaids;

	@Before
	public void setUp() {
		naxx = new NormalAchievType("The Fall of Naxxramas", "576", Lists
				.newArrayList("562", "564", "566", "568", "572", "574"));
		q1 = new NormalAchievType("The Arachnid Quarter", "562", Lists
				.newArrayList("562.Anub'Rekhan", "562.Maexxna",
						"562.Grand Widow Faerlina"));
		q2 = new NormalAchievType("The Construct Quarter", "564", Lists
				.newArrayList("564.Patchwerk", "564.Gluth", "564.Thaddius"));
		q3 = new NormalAchievType("The Plague Quarter", "566", Lists
				.newArrayList("566.Noth the Plaguebringer", "566.Loatheb",
						"566.Heigan the Unclean"));
		q4 = new NormalAchievType("The Military Quarter", "568", Lists
				.newArrayList("568.Instructor Razuvious",
						"568.The Four Horsemen", "568.Gothik the Harvester"));
		dungeonsAndRaids = new AchievTypesTreeImpl(
				Lists.newArrayList(naxx, q1, q2, q3, q4),
				new CategoryAchievType("Dungeons & Raids", "168", Lists.newArrayList("576")));
	}

	@Test
	public void shouldGetAchievementById() {
		AchievType byId = dungeonsAndRaids.findAchievTypeById(q4.getId());
		assertSame(q4, byId);
	}
}
